/*
Date:20210529 22:24PM
key:j作头，i作尾，如果i碰到尾巴，可以再一次全部搬到头部
*/
class MaxQueue {
    int i=-1;
    int j=-1;
    int arr[0xff7]={0};
public:
    MaxQueue() {

    }
    
    int max_value()
    {
        if(i==j){return -1;}
        int max=INT_MIN;
        for(int i1=j+1;i1<=i;i1++)
        {
            if(max<arr[i1]){max=arr[i1];}
        }
        return max;
    }
    
    void push_back(int value) {
    i++;
    arr[i]=value;
    }
    
    int pop_front() {
    if(i==j){return -1;}
    return arr[++j];
    }
};

/**
 * Your MaxQueue object will be instantiated and called as such:
 * MaxQueue* obj = new MaxQueue();
 * int param_1 = obj->max_value();
 * obj->push_back(value);
 * int param_3 = obj->pop_front();
 */